<template>
  <div>
    <div class="row">
      <div>
        <menuBar>
          <monaco-editor></monaco-editor>
        </menuBar>
      </div>
      <inoutbox></inoutbox>
    </div>
  </div>

</template>

<script>
  import inoutbox from './editor/InOutBox.vue'
  import menuBar from './editor/MenuBar.vue'
  import MonacoEditor from './editor/MonacoEditor.vue'

  export default {
    name: 'editor',
    components: {
      menuBar,
      MonacoEditor,
      inoutbox,
    },
    watch: {
      '$route'(to, from) {
        if (to.name === 'root') {
          this.$store.commit('resetCode')
          return
        }

        this.$store.dispatch('loadDataFromServer')
      }
    }
  }
</script>

<style>
  .btn-group .btn {
    margin: 0;
    padding: 0 15px;
    height: 40px;
  }

  .headPanel {
    height: 40px !important;
    padding: 0 15px !important;
  }

  .btn span {
    font-size: 11px;
    font-weight: 700 !important;
  }

  .btn-menu {
    color: #fff !important;
    background-color: transparent;
    margin: auto 0;
  }

  .btn-menu:hover, .btn-menu:active, .btn-menu:focus {
    color: #e31d3b !important;
    box-shadow: none !important;
  }

  .btn i {
    font-size: 12px;
  }
</style>
